<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0">
<title>支付运维平台</title>
<!--header-->
{template _:header}
<style>
.layui-tab {margin:-10px 0 15px 0;}
.layui-form-item .layui-input-inline {margin-right:0;}
#login {background:#EEE;}
#login-content {background:#FFF;width:300px;height:200px;padding:20px;position:absolute;top:50%;left:50%;margin-top:-120px;margin-left:-170px;}
</style>
</head>
<body id="login">
<div id="login-content">
	<div class="layui-form layui-form-pane">
		<div class="layui-tab layui-tab-brief" lay-filter="user_type">
			<ul class="layui-tab-title">
				<li class="layui-this">服务商</li>
				<li class="">代理商</li>
				<li class="">商户</li>
			</ul>
			<div class="layui-tab-content" style="padding:20px 0;">
				<div class="layui-tab-item layui-show">
					<form id="form_console" method="post" action="{echo url('/console/login/doLogin')}">
						<input type="hidden" name="go_url" value="{echo url('/console/index/index')}">
						<!--{if $admin}-->
						<div class="layui-form-item">
							<button type="button" class="layui-btn layui-btn-fluid" onclick="gotourl('{echo url('/console/index/index')}')">已登录：{$admin[username]}</button>
						</div>
						<div class="layui-form-item">
							<button type="button" class="layui-btn layui-btn-fluid" onclick="Logout('{echo url('/console/login/doLogout')}', '{echo url('/')}')">注销登录</button>
						</div>
						<!--{else}-->
						<div class="layui-form-item">
							<label for="username" class="layui-form-label">用户：</label>
							<input type="text" name="username" id="username" class="layui-input layui-input-inline" placeholder="" style="width:188px">
						</div>
						<div class="layui-form-item">
							<label for="password" class="layui-form-label">密码：</label>
							<input type="password" name="password" id="password1" class="layui-input layui-input-inline" placeholder="" style="width:188px">
						</div>
						<div class="layui-form-item" style="text-align:center;">
							<button type="submit" id="submit_console" class="layui-btn layui-btn-fluid">立即登录</button>
						</div>
						<!--{/if}-->
					</form>
				</div>
				<div class="layui-tab-item">
					<form id="form_agent" method="post" action="{echo url('/agent/login/doLogin')}">
						<input type="hidden" name="go_url" value="{echo url('/agent/index/index')}">
						<!--{if $agent}-->
						<div class="layui-form-item">
							<button type="button" class="layui-btn layui-btn-fluid" onclick="gotourl('{echo url('/agent/index/index')}')">已登录：{$agent[agent_no]}</button>
						</div>
						<div class="layui-form-item">
							<button type="button" class="layui-btn layui-btn-fluid" onclick="">{$agent[agent_name]}</button>
						</div>
						<div class="layui-form-item">
							<button type="button" class="layui-btn layui-btn-fluid" onclick="Logout('{echo url('/agent/login/doLogout')}', '{echo url('/')}')">注销登录</button>
						</div>
						<!--{else}-->
						<div class="layui-form-item">
							<label for="agent_no" class="layui-form-label">代理编号：</label>
							<input type="text" name="agent_no" id="agent_no" class="layui-input layui-input-inline" placeholder="" style="width:188px">
						</div>
						<div class="layui-form-item">
							<label for="password" class="layui-form-label">代理密码：</label>
							<input type="password" name="password" id="password2" class="layui-input layui-input-inline" placeholder="" style="width:188px">
						</div>
						<div class="layui-form-item" style="text-align:center;">
							<button type="submit" id="submit_agent" class="layui-btn layui-btn-fluid">立即登录</button>
						</div>
						<!--{/if}-->
					</form>
				</div>
				<div class="layui-tab-item">
					<form id="form_merchant" method="post" action="{echo url('/merchant/login/doLogin')}">
						<input type="hidden" name="go_url" value="{echo url('/merchant/index/index')}">
						<!--{if $merchant}-->
						<div class="layui-form-item">
							<button type="button" class="layui-btn layui-btn-fluid" onclick="gotourl('{echo url('/merchant/index/index')}')">已登录：{$merchant[merchant_no]}</button>
						</div>
						<div class="layui-form-item">
							<button type="button" class="layui-btn layui-btn-fluid" onclick="">{$merchant[merchant_name]}</button>
						</div>
						<div class="layui-form-item">
							<button type="button" class="layui-btn layui-btn-fluid" onclick="Logout('{echo url('/merchant/login/doLogout')}', '{echo url('/')}')">注销登录</button>
						</div>
						<!--{else}-->
						<div class="layui-form-item">
							<label for="merchant_no" class="layui-form-label">商户编号：</label>
							<input type="text" name="merchant_no" id="merchant_no" class="layui-input layui-input-inline" placeholder="" style="width:188px">
						</div>
						<div class="layui-form-item">
							<label for="password" class="layui-form-label">商户密码：</label>
							<input type="password" name="password" id="password3" class="layui-input layui-input-inline" placeholder="" style="width:188px">
						</div>
						<div class="layui-form-item" style="text-align:center;">
							<button type="submit" id="submit_merchant" class="layui-btn layui-btn-fluid">立即登录</button>
						</div>
						<!--{/if}-->
					</form>
				</div>
			</div>
		</div>
	</div>
</div>
{template _:footer}
<script type="text/javascript">
$(function(){
	//
});
$(document).ready(function(){
	//
});
layui.use(["form", "element"], function(){
	var form = layui.form;
	var element = layui.element;
	element.on("tab(user_type)", function(elem){

	});
});
$("#submit_console").click(function(){
	ajaxSubmit(this, "", "#form_console", function(){
		gotourl($("#form_console").find("input[name='go_url']").val());
	});
});
$("#submit_agent").click(function(){
	ajaxSubmit(this, "", "#form_agent", function(){
		gotourl($("#form_agent").find("input[name='go_url']").val());
	});
});
$("#submit_merchant").click(function(){
	ajaxSubmit(this, "", "#form_merchant", function(){
		gotourl($("#form_merchant").find("input[name='go_url']").val());
	});
});
</script>
</body>
</html>